package com.yq.common.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.yq.common.model.sys.SystemCount;
import com.yq.common.model.User;

import com.yq.common.greendao.gen.SystemCountDao;
import com.yq.common.greendao.gen.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig systemCountDaoConfig;
    private final DaoConfig userDaoConfig;

    private final SystemCountDao systemCountDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        systemCountDaoConfig = daoConfigMap.get(SystemCountDao.class).clone();
        systemCountDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        systemCountDao = new SystemCountDao(systemCountDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(SystemCount.class, systemCountDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        systemCountDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public SystemCountDao getSystemCountDao() {
        return systemCountDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
